<script src="app/controllers/sitemaps/AddSitemapController.js"></script>

<!-- Menu Navigation -->
<div class="hfr-nav container hfr-margin-auto">
	<a href="#/"><span class="ti-home"></span> Dashboard</a>
	<div class="right">
		<a href="#/site-management">Site Management</a>
		<a href="#/monitor-posted">Monitor Posted</a>
	</div>
</div>
<!-- Add Sitemap -->
<div id="hfr-addSitemap" class="hfr-mw800 hfr-margin-auto" ng-controller="AddSitemapController">
	<h2 class="hfr-heading">{{pageTitle}}</h2>
	<form class="hfr-formAddSitemap" name="smForm">
		<div class="form-group">
			<label>Sitemap URL</label>
			<span class="label label-danger" ng-show="submitted && smForm.sitemap.$error.required">Required!</span>
			<span class="label label-danger" ng-show="submitted && smForm.$error.url">Invalid URL format!</span>
			<div class="input-group">
				<input type="url" placeholder="Sitemap" class="form-control" ng-model="slf.sitemap" ng-init="slf.sitemap=init.sitemap" name="sitemap" required>
				<span class="input-group-addon ti-world"></span>
			</div>
		</div>
		<br />
		<div class="form-group">
			<label>Selector Information</label>
			<span class="label label-danger" ng-show="submitted && smForm.customSelector.$error.required">Required!</span>
			<textarea class="form-control" ng-model="slf.customSelector" ng-init="slf.customSelector=init.customSelector" name="customSelector" id="selector-id" ui-codemirror ui-codemirror-opts="editorOptions"></textarea>
		</div>
		<div class="form-group">
			<button type="button" class="hfr-button-light hfr-solid" data-toggle="modal" data-target=".hfr-postPreviewModal" ng-hide="success" ng-click="preview(smForm)">Preview</button>
			&nbsp;
			<button href="#/site-mangement" class="hfr-button-blue hfr-solid" type="submit" ng-show="success">Site Management</button>		
		</div>
		<div class="hfr-inputStyle">
			<input type="checkbox" name="hfr-openAddSitemap" id="hfr-openAddSitemap">
			<label for="hfr-openAddSitemap">						
				Are you sure about correctness of script/selector before adding source ?
			</label>
		</div>
	</form>
		<!-- Post preview modal -->
	<script type="text/ng-template" id="postPreview.html">
		<form class="hfr-formAddSitemap" name="otForm">
			<div class="modal-header">
				<div class="content-right">
					<span class="ti-close" data-dismiss="modal" title="close" ng-click="close()"></span>
				</div>
				<div class="row">
					<div class="col-md-12">
						<tabset>
							<!-- TAB PREVIEW -->
							<tab active="tab.active">
								<tab-heading><span class="ti-desktop"></span>Post Preview</tab-heading>
								<div id="hfr-postPreview">
									<div>
										<span class="ti-link"></span> 
										<a href target="_blank">
											{{link}}
										</a>
									</div>
									<div><span class="ti-pencil"></span> {{title}}</div>
									<div>
										<span class="ti-align-left"></span>
										<div ng-bind-html="content"></div>
									</div>
								</div>
							</tab>
							<!-- TAB PREVIEW END -->
							
							<!-- TAB OPTION -->
							<tab>
								<tab-heading><span class="ti-settings"></span>Options</a></tab-heading>
								<div id="hfr-postOptions">											
									<div class="row">
										<div class="col-md-6">
											<div class="form-group hfr-frequency">
												<label for="amount">Frequency :</label>
												<input type="text" id="amount" readonly style="border:0; color:#f6931f; font-weight:bold;" ng-model="otf.frequency" ng-init="otf.frequency='abc'">
												<div id="slider-range-min"></div>
											</div>
											<div class="hfr-otherOptions">
												<div class="form-group">
													<div class="row">
														<div class="col-md-5">Get All Link</div>
														<div class="col-md-7">
															<ul class="hfr-inputStyle list-2-cols">
																<li>
																	<input type="radio" id="hfr-getAllLinkYes" ng-model="otf.getAll" value="Yes">
																	<label for="hfr-getAllLinkYes">Yes</label>
																</li>
																<li>
																	<input type="radio" id="hfr-getAllLinkNo"  ng-model="otf.getAll" value="No">
																	<label for="hfr-getAllLinkNo">No</label>
																</li>
															</ul>
														</div>
													</div>
												</div>
												<div class="form-group">
													<div class="row">
														<div class="col-md-5">Remove tag &lt;a&gt;</div>
														<div class="col-md-7">
															<ul class="hfr-inputStyle list-2-cols">
																<li>
																	<input type="radio" id="hfr-removeTagYes" ng-model="otf.removeTagA" value="Yes">
																	<label for="hfr-removeTagYes">Yes</label>
																</li>
																<li>
																	<input type="radio" id="hfr-removeTagNo" ng-model="otf.removeTagA" value="No">
																	<label for="hfr-removeTagNo">No</label>
																</li>
															</ul>
														</div>
													</div>
												</div>
												<div class="form-group">
													<div class="row">
														<div class="col-md-5">Share</div>
														<div class="col-md-7">
															<ul class="hfr-inputStyle list-2-cols">
																<li>
																	<input type="radio" id="hfr-shareYes" ng-model="otf.share" value="Yes">
																	<label for="hfr-shareYes">Yes</label>
																</li>
																<li>
																	<input type="radio" id="hfr-shareNo" ng-model="otf.share" value="No">
																	<label for="hfr-shareNo">No</label>
																</li>
															</ul>
														</div>
													</div>
												</div>
												<div class="form-group">
													<div class="row">
														<div class="col-md-5">Source</div>
														<div class="col-md-7">
															<ul class="hfr-inputStyle list-2-cols">
																<li>
																	<input type="radio" id="hfr-sourceYes" ng-model="otf.source" value="Yes">
																	<label for="hfr-sourceYes">Yes</label>
																</li>
																<li>
																	<input type="radio" id="hfr-sourceNo" ng-model="otf.source" value="No">
																	<label for="hfr-sourceNo">No</label>
																</li>
															</ul>
														</div>
													</div>
												</div>
												<div class="form-group">
													<div class="row">
														<div class="col-md-5">Link</div>
														<div class="col-md-7">
															<ul class="hfr-inputStyle list-2-cols">
																<li>
																	<input type="radio" id="hfr-linkNofollow" ng-model="otf.typelink" value="nofollow">
																	<label for="hfr-linkNofollow">Nofollow</label>
																</li>
																<li>
																	<input type="radio" id="hfr-linkFollow" ng-model="otf.typelink" value="follow">
																	<label for="hfr-linkFollow">Follow</label>
																</li>
															</ul>
														</div>
													</div>
												</div>
												<div class="form-group">
													<div class="row">
														<div class="col-md-5">Source Type</div>
														<div class="col-md-7">
															<ul class="hfr-inputStyle list-2-cols">
																<li>
																	<input type="radio" id="hfr-sourceTypeText" ng-model="otf.sourceType" value="text">
																	<label for="hfr-sourceTypeText">Text</label>
																</li>
																<li>
																	<input type="radio" id="hfr-sourceTypeLink" ng-model="otf.sourceType" value="link">
																	<label for="hfr-sourceTypeLink">Link</label>
																</li>
															</ul>
														</div>
													</div>
												</div>
												<div class="form-group">
													<div class="row">
														<div class="col-md-5">Source Image</div>
														<div class="col-md-7">
															<ul class="hfr-inputStyle list-2-cols">
																<li>
																	<input type="radio" id="hfr-sourceImageOriginal" ng-model="otf.sourceImage" value="original">
																	<label for="hfr-sourceImageOriginal">Original</label>
																</li>
																<li>
																	<input type="radio" id="hfr-sourceImageCdn" ng-model="otf.sourceImage" value="cdn">
																	<label for="hfr-sourceImageCdn">CDN</label>
																</li>
															</ul>
														</div>
													</div>
												</div>
											</div>		
										</div>
										<div class="col-md-6">
											<div class="form-group hfr-topics">
												<p><strong>Topic</strong></p>
												<div class="input-group">
													<input type="text" class="form-control" placeholder="Ex : topic-1, topic-2" id="hfr-inputCategory" ng-model="otf.category" ng-init="otf.category=''">
													<span class="input-group-addon ti-folder"></span>
												</div>
												<ul class="hfr-inputStyle list-2-cols">
				                                  			<li>
				                                  				<input type="checkbox" id="hfr-category-blogs">
														<label for="hfr-category-blogs">Blogs</label>
				                                                 <span title="remove" class="ti-close remove-category"></span>
				                                             </li>
				                                         </ul>
											</div>
										</div>
									</div>
								</div>
							</tab>
							<!-- TAB OPTION END -->
						</tabset>
					</div>
				</div>
			</div>
			<div class="modal-footer" ng-show="addSitemap">
				<button type="submit" class="hfr-button-blue hfr-solid" ng-click="submit(otForm)">Add Sitemap</button>
			</div>
		</form>
	</script>
</div>